package mvc.elicoide;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;

import org.render.IRenderer;

import mvc.model.ModelCurve;
import mvc.view.ViewCurve;

public class ViewCurveElicoide3D extends ViewCurve{ private static final long serialVersionUID = 1L;

	public ViewCurveElicoide3D(ModelCurve model, IRenderer r, Dimension d,
			String title) {
		super(model, r, d, title);
	}
	
	@Override
	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		
		drawStringCurrentT(g);
		drawStringParameters(g); 
	}

	private void drawStringParameters(Graphics g) {
		if (ControllerElicoide2D.mousePressed) {
			//System.out.println("Foo added");
			g.drawString("R: "+getR(), 50, 70);
			g.drawString("K: "+getK(), 50, 85);
		}
	}

	private void drawStringCurrentT(Graphics g) {
		g.setColor(new Color(0,0,0,140));
		g.drawString("Current t :"+getT(), 50, 50);
	}
	
	private String getT() {
		return df.format(model.getCurrentT());
	}

	private String getK() {
		return df.format(((IModelElicoide)model).getK());
	}

	private String getR() {
		return df.format(((IModelElicoide)model).getR());
	}

}
